﻿using KayakMes.Common.Dtos.WarehouseManageDto.Input;
using KayakMes.Common.Dtos.WarehouseManageDto.Output;
using KayakMes.Common.Result;
using KayakMes.WarehouseManage.Domain.Entities;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace KayakMes.WarehouseManage.Application
{
    /// <summary>
    /// 仓库管理服务接口
    /// 提供采购订单相关的业务操作功能，包括增删改查等操作
    /// </summary>
    public interface IWarehouseManageServices
    {
        #region 采购订单相关操作
        /// <summary>
        /// 添加采购订单
        /// </summary>
        /// <param name="purchaseOrderModel">采购订单模型</param>
        /// <returns>返回操作结果，包含新增订单的ID</returns>
        ApiResult<int> AddPurchaseOrder(PurchaseOrderModel purchaseOrderModel);

        /// <summary>
        /// 更新采购订单信息
        /// </summary>
        /// <param name="purchaseOrderModel">采购订单模型</param>
        /// <returns>返回操作结果，包含受影响的行数</returns>
        ApiResult<int> UpdatePurchaseOrder(PurchaseOrderModel purchaseOrderModel);

        /// <summary>
        /// 获取采购订单列表（支持分页和查询条件）
        /// </summary>
        /// <param name="dto">采购订单查询条件DTO</param>
        /// <returns>返回分页的采购订单列表</returns>
        ApiPaging<PurchaseOrderModel> GetAllPurchaseOrders(PurchaseOrderDto dto);

        /// <summary>
        /// 根据ID获取指定的采购订单
        /// </summary>
        /// <param name="id">采购订单ID</param>
        /// <returns>返回操作结果，包含指定的采购订单信息</returns>
        ApiResult<PurchaseOrderModel> GetPurchaseOrder(long id);
        string GetCode();
        /// <summary>
        /// 逻辑删除
        /// </summary>
        /// <param name="Id">采购订单ID</param>
        /// <returns>返回操作结果，包含删除操作的影响行数</returns>
        ApiResult<int> LogicDel(long Id);
        #endregion

        #region 仓库相关操作
        ApiResult<int> AddWarehouse(WarehouseAddDto warehouseModel);
        ApiResult<int> UpdateWarehouse(WarehouseModel warehouseModel);
        ApiResult<int> LogicDelWarehouse(long Id);
        ApiPaging<WarehouseModel> GetAllWarehouse(WarehouseDto dto);
        ApiResult<WarehouseModel> GetWarehouse(long Id);
        ApiResult<List<WarehouseOutput>> ComboBoxWarehouse();
        string GetWarehouseCode();
        #endregion

        #region 库区相关操作
        ApiResult<int> AddWarehouseArea(WarehouseAreaAddDto  dto);
        ApiResult<int> UpdateWarehouseArea(WarehouseAreaModel model);
        ApiResult<int> LogicDelWarehouseArea(long Id);
        ApiPaging<WarehouseAreaOutput> GetAllWarehouseArea(WarehouseAreaDto dto);
        ApiResult<WarehouseAreaModel> GetWarehouseArea(long Id);
        string GetWarehouseAreaCode();
        #endregion
    }

}
